<extend name="../Public/model" />
<block name="css">
    <link rel="stylesheet" href="__PUBLIC__/lib/webuploader/webuploader.css?v=0.1.5" />
</block>
<block name="title"><title>添加{$TITLE}</title></block>
<block name='nav'>
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i>添加{$TITLE}</nav>
</block>
<block name="body">
    <form class="form form-horizontal" id="form-article-add" action="{:U('add')}" method="post">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>{$TITLE}标题：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text wp55" value="" placeholder="" name="title">
                <input type="text" name="titleshort" placeholder="简短标题，建议6~12字数" class="input-text wp30" style="margin-left:10px;">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>分类栏目：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box wp55">
				<select name="cate_id" class="select">
                   <volist name="cates" id="var">
                        <option value="{$var.cate_id}">{$var.cate_name}</option>
                    </volist>
                </select>
				</span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">作者：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text wp55" value="小虾米" placeholder="" id="" name="author">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">标签：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <foreach name="tags" item="var">
                    <div class="check-box">
                        <input type="checkbox" name="tag_ids[]" value="{$var['tag_id']}">
                        <label>{$var['tag_name']}</label>
                    </div>
                </foreach>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">关键词：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text wp55" value="" placeholder=""  name="keywords">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">摘要：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <textarea name="description" cols="" rows="" class="textarea wp55"  placeholder="说点什么..." datatype="*-200"  onKeyUp="textarealength(this,200)"></textarea>
                <p class="textarea-numberbar"><em class="textarea-length">0</em>/200</p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">缩略图：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <div class="row cl">
                    <div class="formControls col-xs-11 col-sm-12">
                        <div class="uploader-thum-container">
                            <input type="hidden" name="litpic" value="" id="data_litpic" />
                            <input type="hidden" name="checkpic" id="checkpic" value="{$detail.litpic}" />
                            <input type="hidden" name="oldcheckpic" id="oldcheckpic" value="{$detail.litpic}" />
                            <div id="fileList" class="uploader-list"><img id="photo_img" width="80" height="80" src="__PUBLIC__/img/{$detail.litpic|default='default.jpg'}" /></div>
                            <div id="filePicker">选择图片</div>
                            <a href="javascript:;" onClick="return backpic('{$detail.litpic|default="__PUBLIC__/img/default.jpg"}');" title="还原修改前的图片" class="btn btn-default radius ml-10">撤销上传</a>
                            <a href="{:U('Admin/Setting/site')}" class="ml-10">缩略图设置</a>
                        </div>
                    </div>
                </div>

            </div>
        </div>
        <!--<div class="row cl">-->
            <!--<label class="form-label col-xs-4 col-sm-2">文档图集：</label>-->
            <!--<div class="formControls col-xs-8 col-sm-9">-->
                <!--<div class="radio">-->
                    <!--<div class="radio-box">-->
                        <!--<input name="news_pic_type" id="news_pic_list" checked="" type="radio" value="1">-->
                        <!--<label><span class="lbl"> 无图模式</span></label>-->
                    <!--</div>-->
                    <!--<div class="radio-box">-->
                        <!--<input name="news_pic_type" id="news_pic_qqlist" type="radio" value="2">-->
                        <!--<label><span class="lbl"> 多图模式</span></label>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div id="pic_list" class="uploader-list-container">-->
                    <!--<div class="queueList">-->
                        <!--<div id="dndArea" class="placeholder">-->
                            <!--<div id="filePicker-2"></div>-->
                            <!--<p>或将照片拖到这里，单次最多可选300张</p>-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="statusBar" style="display:none;">-->
                        <!--<div class="progress"> <span class="text">0%</span> <span class="percentage"></span> </div>-->
                        <!--<div class="info"></div>-->
                        <!--<div class="btns">-->
                            <!--<div id="filePicker2"></div>-->
                            <!--<div class="uploadBtn">开始上传</div>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">内容：</label>
            <div class="formControls col-xs-8 col-sm-9" style="height:500px">
                <script id="editor" name="content" type="text/plain" style="width:100%;height:400px;"></script>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">是否置顶：</label>
            <div class="formControls col-xs-8 col-sm-9 skin-minimal">
                <div class="radio-box">
                    <input name="is_top" type="radio" value="1" id="is_top-1">
                    <label for="is_top-1">是</label>
                </div>
                <div class="radio-box">
                    <input name="is_top" type="radio"  value="0" id="is_top-2" checked>
                    <label for="is_top-2">否</label>
                </div>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">是否显示：</label>
            <div class="formControls col-xs-8 col-sm-9 skin-minimal">
                <div class="radio-box">
                    <input name="status" type="radio"  value="1" id="status-1" checked>
                    <label for="status-1">是</label>
                </div>
                <div class="radio-box">
                    <input name="status" type="radio"  value="0" id="status-2">
                    <label for="status-2">否</label>
                </div>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">点击数：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="100" placeholder=""  name="click">
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button  class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存并提交审核</button>
                <button onClick="article_save();" class="btn btn-secondary radius" type="button"><i class="Hui-iconfont">&#xe632;</i> 保存草稿</button>
                <button onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</block>
<block name="js">

<script type="text/javascript" src="__PUBLIC_LIB__/webuploader/webuploader.js?v=0.1.5"></script>
<script type="text/javascript" src="__PUBLIC_LIB__/ueditor/ueditor.config.js?v=1.4.3"></script>
<script type="text/javascript" src="__PUBLIC_LIB__/ueditor/ueditor.all.min.js?v=1.4.3"> </script>
<script type="text/javascript" src="__PUBLIC_LIB__/ueditor/lang/zh-cn/zh-cn.js?v=1.4.3"></script>
    <script type="text/javascript">

        function backpic(picurl) {
            $("#img0").attr("src", picurl);//还原修改前的图片
            $("input[name='oldcheckpic']").val(picurl);//清空文本框的值
        }

        $(function(){



//                //多图设置
//            $("#pic_list").hide();
//            $("#news_pic_list").click(function(){
//                $("#pic_list").hide();
//            });
//            $("#news_pic_qqlist").click(function(){
//                $("#pic_list").show();
//            });
//            //跳转额外属性
//            $("#pptaddress").hide();
//            $("#news_flag_vaj").click(function(){
//                $("#pptaddress").toggle(400);
//            });

            //editor编辑器
            var ue = UE.getEditor('editor');

            //图片上传
            upload_one_image();

            //
            //upload_multi();

        });
    </script>
    <script type="text/javascript" src="__ADMIN_JS__/upload.js"></script>
</block>